package com.yonyou.brigade.third_parties.smectrip.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yonyou.brigade.basic_init.model.BriChannel;
import com.yonyou.brigade.third_parties.smectrip.model.CtripSmeUser;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * Created by Administrator on 2018/12/25.
 */
public interface ISmeCtripPublicService {
    //同步携程商旅通用户
    boolean syncCtripSmeUsers(String tenant, JSONArray memberInfoModelArray, String config);

    String ssoLogin(CtripSmeUser ctripSmeUser, HttpServletResponse
            response, String config, String initPage, String source) throws IOException;


    /**
     * 中小企业 自助开通携程服务 注册公司
     *
     * @param companyCode  目前取租户ID
     * @param companyName  目前取租户名
     * @param isPreApprove 是否提前审批
     * @return <code>JSONObject</code> appKey appSecurity ctripCorpId
     * @throws Exception
     */
    JSONObject autoRegisterCompany(String companyCode, String companyName, Integer isPreApprove);


    String getSetApprovalTicket(BriChannel channel) throws IOException;

    /**
     * 向携程商旅通推送申请单
     * @param channel
     * @param tenant
     * @param orgpk
     * @param applyOrderJson
     * @return
     */
    JSONObject pushApplayOrder(BriChannel channel, String tenant, String orgpk, JSONObject applyOrderJson);

    /*
    关闭申请单同步到携程大客户
     */
    List closeApplyOrder( BriChannel channel , JSONObject trip);
}